<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">供方整改管理</li>
      
      <a href="javascript:window.history.back();" class="pull-right" style="margin-right: 5px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
    </ol>
  
    <div class="ms-content-layout">
  
      <div class="block-heading">
        <h5>约谈整改基本信息</h5>
        <a href="${ctx.host}/reforms/${reform.id}/edit" data-target="#edit" data-toggle="modal" title="edit"
           class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑
        </a>
      </div>
  
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">
  
        <div class="form-group ms-form-group">
          <label class="col-xs-3 control-label">约谈内容：</label>
          <div class="pull-left col-xs-8">
            <p class="form-control-static">${reform.theme}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">发起人：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${persist.user(reform.creator).loginName}</p>
          </div>
  
          <label class="control-label col-xs-2 ">约谈时间：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${reform.appointTime}"/></p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">被约谈公司：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${reform.recipient.name}</p>
          </div>
  
          <c:if test="${not empty reform.originate}">
            <label class="control-label col-xs-2 ">约谈公司：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static">${reform.originate.name}</p>
            </div>
          </c:if>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">是否关闭：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${reform.closed ? '是' : '否'}</p>
          </div>
  
          <c:if test="${reform.closed}">
            <label class="control-label col-xs-2 ">关闭时间：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${reform.closeTime}"/></p>
            </div>
          </c:if>
        </div>
        
         <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">整改结果：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${reform.reformStatus.description}</p>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">整改到期时间：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${reform.endTime}"/></p>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3">附件一：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty reform.annexOne}">
                <p class="form-control-static">
                  <a href="${reform.annexOne}" download>下载</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/reforms/${reform.id}/upload-annex?type=annexOne" data-target="#upload" data-toggle="modal">重新上传</a>
                </p>
              </c:when>
              <c:otherwise>
                <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/reforms/${reform.id}/upload-annex?type=annexOne" data-target="#upload" data-toggle="modal">上传附件一</a>
              </c:otherwise>
            </c:choose>
          </div>
  
          <label class="control-label col-xs-2">附件二：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty reform.annexTwo}">
                <p class="form-control-static">
                  <a href="${reform.annexTwo}" download>下载</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/reforms/${reform.id}/upload-annex?type=annexTwo" data-target="#upload" data-toggle="modal">重新上传</a>
                </p>
              </c:when>
              <c:otherwise>
                <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/reforms/${reform.id}/upload-annex?type=annexTwo" data-target="#upload" data-toggle="modal">上传附件二</a>
              </c:otherwise>
            </c:choose>
          </div>
        </div>
        
        <div class="form-group ms-form-group" style="margin-top: 5px;">
          <label class="col-xs-3 control-label">出席人员：</label>
          <div class="pull-left col-xs-8">
            <p class="form-control-static">${reform.attendee}</p>
          </div>
        </div>
        
        <div class="form-group ms-form-group" style="margin-top: 5px;">
          <label class="col-xs-3 control-label">约谈详情：</label>
          <div class="pull-left col-xs-8">
            <p class="form-control-static">${reform.description}</p>
          </div>
        </div>
  
      </div>

    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/reform/management/reform-view.js"/>
  <script type="text/javascript">
    require(['page/supplier/reform/management/reform-view'], function (page) {
      page.init()
    })
  </script>

</body>
</html>